<template>
  <div id="payFromView" ref="pay" v-html="form"></div>
</template>
<script lang="ts" setup>
import { useRoute } from "vue-router";
import { onMounted, ref } from "vue";
import { ElLoading } from "element-plus";

const route = useRoute();
const pay = ref();

const form = route.query.form;

onMounted(() => {
  const loading = ElLoading.service({
    lock: true,
    text: "跳转中...",
    background: "rgba(0, 0, 0, 0.7)",
  });
  if (pay.value) {
    pay.value.children[0].submit();
    loading.close;
  }
});
</script>
